package io;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 转换流读取文本数据
 */
public class ISRDemo {
    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(new FileInputStream("./src/main/java/io/ISRDemo.java"));
        String line ="";
        //read()返回-1表示读取到了末尾
        int d ;
        while ((d = isr.read()) != -1){
            //读取第一个字符，并输出
            System.out.print((char)d);
        }
    }
}
